/**
	页面头部js文件
*/
function initHeader(memuFun,callback){
	/**加载房间列表*/
	var roomId = getSearchParam('roomId');
	$.ajax({
		url:'../room/roomList.do',
		type:'get',
		dataType:'json',
		success:function(d){
			for(var i in d.data){
				var curClass = '';
				if(roomId == d.data[i].id){
					curClass = 'head-nav-active';
					//document.title = d.data[i].name + '解盘';
				}
				var template = '<div class="col-xs-3 nav-header-title '+curClass+'"><h3>'+d.data[i].name+'</h3></div>';
				var $template = $(template);
				$template.data('data',d.data[i]);
				$template.click(function(){
					var $this = $(this);
					var data = $this.data('data');
					memuFun(data);
				});
				$('header').append($template);
			}
			navHeaderActive();//为头菜单添加点击后选中样式事件
			callback();
		}
	});
}

